package com.ruoyi.yipaiju.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yipaiju.mapper.StorageRelationshipMapper;
import com.ruoyi.yipaiju.domain.StorageRelationship;
import com.ruoyi.yipaiju.service.IStorageRelationshipService;

/**
 * fo_storage_relationshipService业务层处理
 * 
 * @author liuwp
 * @date 2023-03-01
 */
@Service
public class StorageRelationshipServiceImpl implements IStorageRelationshipService 
{
    @Autowired
    private StorageRelationshipMapper storageRelationshipMapper;

    /**
     * 查询fo_storage_relationship
     * 
     * @param id fo_storage_relationship主键
     * @return fo_storage_relationship
     */
    @Override
    public StorageRelationship selectStorageRelationshipById(Long id)
    {
        return storageRelationshipMapper.selectStorageRelationshipById(id);
    }

    /**
     * 查询fo_storage_relationship列表
     * 
     * @param storageRelationship fo_storage_relationship
     * @return fo_storage_relationship
     */
    @Override
    public List<StorageRelationship> selectStorageRelationshipList(StorageRelationship storageRelationship)
    {
        return storageRelationshipMapper.selectStorageRelationshipList(storageRelationship);
    }

    /**
     * 根据业务主键查询一条记录：fo_storage_relationship
     *
     * @param storageRelationship fo_storage_relationship
     * @return fo_storage_relationship
     */
    @Override
    public StorageRelationship selectOneStorageRelationship(StorageRelationship storageRelationship)
    {
        return storageRelationshipMapper.selectOneStorageRelationship(storageRelationship);
    }

    /**
     * 新增fo_storage_relationship
     * 
     * @param storageRelationship fo_storage_relationship
     * @return 结果
     */
    @Override
    public int insertStorageRelationship(StorageRelationship storageRelationship)
    {
        storageRelationship.setCreateTime(DateUtils.getNowDate());
        return storageRelationshipMapper.insertStorageRelationship(storageRelationship);
    }

    /**
     * 修改fo_storage_relationship
     * 
     * @param storageRelationship fo_storage_relationship
     * @return 结果
     */
    @Override
    public int updateStorageRelationship(StorageRelationship storageRelationship)
    {
        storageRelationship.setUpdateTime(DateUtils.getNowDate());
        return storageRelationshipMapper.updateStorageRelationship(storageRelationship);
    }

    @Override
    public int updateStorageRelationshipCondition(StorageRelationship storageRelationship, StorageRelationship storageRelationshipCondition)
    {
                storageRelationship.setUpdateTime(DateUtils.getNowDate());
        return storageRelationshipMapper.updateStorageRelationshipCondition(storageRelationship, storageRelationshipCondition);
    }

    /**
     * 批量删除fo_storage_relationship
     * 
     * @param ids 需要删除的fo_storage_relationship主键
     * @return 结果
     */
    @Override
    public int deleteStorageRelationshipByIds(Long[] ids)
    {
        return storageRelationshipMapper.deleteStorageRelationshipByIds(ids);
    }

    /**
     * 删除fo_storage_relationship信息
     * 
     * @param id fo_storage_relationship主键
     * @return 结果
     */
    @Override
    public int deleteStorageRelationshipById(Long id)
    {
        return storageRelationshipMapper.deleteStorageRelationshipById(id);
    }

    /**
     * 条件删除fo_storage_relationship
     *
     * @param storageRelationship fo_storage_relationship
     * @return 结果
     */
    @Override
    public int deleteStorageRelationshipByCondition(StorageRelationship storageRelationship)
    {
        return storageRelationshipMapper.deleteStorageRelationshipByCondition(storageRelationship);
    }

    @Override
    public int insertStorageRelationshipList(List<StorageRelationship> storageRelationships) {
        return storageRelationshipMapper.insertStorageRelationshipList(storageRelationships);
    }

}
